<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>
    <button onclick="download()">导出</button>
    <script>
        function download() {
            $.ajax({
                url:'http://localhost:8080/export',
                success: function(data, status){
                    console.log(data, status)
                    if (data.code === 200){
                        window.location.href = "http://localhost:8080/download?fileName=" + encodeURI('test.xls') + "&delete=" + true
                    }
                }
            })
        }
    </script>
</body>
</html>